<?php
/**
 * tvb log pattern
 *
 * this file get pattern factory
 * 
 * @author William Hu <william.hu@achievo.com>
 * @version 1.0
 * @package TVBLog
 */
class TVB_Logger_Pattern
{
    /**
     * Log a message to this writer.
     *
     * @param  string $type
     * @return object
     */
    public static function get($type)
	{
		require_once "TVB/Logger/Pattern/{$type}.php";
		$class_name = "TVB_Logger_Pattern_{$type}";
	    if (!class_exists($class_name)) {
            require_once 'TVB/Logger/Exception.php';
			throw new TVB_Logger_Exception("No exists class: ".$class_name);
        }
		$obj = new $class_name;
		return $obj;
	}
}
